﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace PClass
{
    public class Parameter
    {
        /// <summary>
        /// 电动机参数
        /// </summary>
        public class Electromotor
        {
            /// <summary>
            /// 横向运动控制电机功率
            /// 单位:kW
            /// </summary>
            private float hPower;
            /// <summary>
            /// 横向运动控制电机电流
            /// 单位:A
            /// </summary>
            private float hElectricity;
            /// <summary>
            /// 横向运动控制电机转速
            /// 单位:r/s
            /// </summary>
            private float hSpeed;
            /// <summary>
            /// 纵向运动控制电机功率
            /// 单位:kW
            /// </summary>
            private float lPower;
            /// <summary>
            /// 纵向运动控制电机电流
            /// 单位:A
            /// </summary>
            private float lElectricity;
            /// <summary>
            /// 纵向运动控制电机转速
            /// 单位:r/s
            /// </summary>
            private float lSpeed;

            [Description("设置横向运动电机功率\n单位:kW")]
            [DefaultValue(2)]
            public float HPower
            {
                get { return hPower; }
                set 
                { 
                    hPower = value;
                    if (hPower < 0)
                        hPower = 0f;
                }
            }

            [DefaultValue(5)]
            [Description("设置横向运动电机工作电流\n单位:A")]
            public float HElectricity
            {
                get { return hElectricity; }
                set 
                { 
                    hElectricity = value;
                    if (hElectricity < 0)
                        hElectricity = 0f;
                }
            }

            [DefaultValue(20)]
            [Description("设置横向运动电机工作转速\n单位:r/s")]
            public float HSpeed
            {
                get { return hSpeed; }
                set { hSpeed = value; }
            }

            [DefaultValue(2)]
            [Description("设置纵向运动电机功率\n单位:kW")]
            public float LPower
            {
                get { return lPower; }
                set
                {
                    lPower = value;
                    if (lPower < 0)
                        lPower = 0f;
                }
            }

            [DefaultValue(5)]
            [Description("设置纵向运动电机工作电流\n单位:A")]
            public float LElectricity
            {
                get { return lElectricity; }
                set
                {
                    lElectricity = value;
                    if (lElectricity < 0)
                        lElectricity = 0f;
                }
            }

            [DefaultValue(20)]   
            [Description("设置纵向运动电机工作转速\n单位:r/s")]
            public float LSpeed
            {
                get { return lSpeed; }
                set { lSpeed = value; }
            }
        }
    }
}
